﻿using System;
using UnityEngine;

namespace SteeringBehaviors
{
	// Token: 0x0200021C RID: 540
	public class Face : Align
	{
		// Token: 0x06000B53 RID: 2899 RVA: 0x0005F40F File Offset: 0x0005D60F
		public Face(MovementCharacter agent, IKinematic target) : base(agent, target)
		{
		}

		// Token: 0x06000B54 RID: 2900 RVA: 0x0005F41C File Offset: 0x0005D61C
		public override SteeringOutput GetSteering()
		{
			Vector3 vector = this.target.position - this.agent.transform.position;
			if (vector.magnitude > 0f)
			{
				this.targetOrientation = Mathf.Atan2(vector.x, vector.z) * 57.29578f;
				if (Mathf.Abs(base.MapToRange(this.agent.orientation - this.targetOrientation)) < this.targetRadius)
				{
					this.agent.Stop();
				}
			}
			return base.GetSteering();
		}
	}
}
